<?php

namespace Database\Factories;

use App\Models\Buy;
use Illuminate\Database\Eloquent\Factories\Factory;

class BuyFactory extends Factory
{
  /**
   * The name of the factory's corresponding model.
   *
   * @var string
   */
  protected $model = Buy::class;

  /**
   * Define the model's default state.
   *
   * @return array
   */
  public function definition()
  {
    return [
      "id" => app('snowflake')->id(),
      "seller_id" => 3,
      "member_id" => $this->faker->numberBetween(7, 18),
      'transaction_id' => $this->faker->optional()->ean13,
      // "money" => $this->faker->numberBetween(10, 222),
      'realname' => $this->faker->name,
      'bank' => $this->faker->bank,
      'bankcard' => $this->faker->creditCardNumber,
      "coins" => $this->faker->numberBetween(10, 222),
      "deposit" => $this->faker->numberBetween(50, 255),
      "fee" => $this->faker->numberBetween(1, 20),
      "seller_fee" => $this->faker->numberBetween(1, 20),
      "agent_fee" => $this->faker->numberBetween(1, 20),
      "tip" => $this->faker->numberBetween(1, 20),
      "seller_tip" => $this->faker->numberBetween(1, 20),
      "agent_tip" => $this->faker->numberBetween(1, 20),
      "agent_id" =>  rand(0, 1) ? 20 : 4,
      "took_at" => $this->faker->dateTimeThisMonth,
      // "frozen_at" => $this->faker->dateTimeThisMonth,
      "unfreeze_at" => $this->faker->dateTimeThisMonth,
      "state" => $this->faker->numberBetween(1, 4),
      'callback_ok' => random_int(0, 1),
      // 'callback_url' => $this->faker->url,
      'callback_num' => random_int(0, 3),
    ];
  }
}
